package main

func Fac(n int) int {
	if n == 1 {
		return 1
	}
	return n * Fac(n-1)
}

func FacTail(n, total int) int {
	return helper(n-1, n)
}

func helper(n, current int) int {
	if n == 1 {
		return current
	}
	return helper(n-1, n*current)
}
